package ssf.app.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;
import ssf.app.form.EmployeeForm;
import ssf.app.service.EmployeeService;
import ssf.app.service.ServiceManager;


public class AddEmployeeAction extends BaseAction
{

    public AddEmployeeAction()
    {
    }

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws Exception
    {
        EmployeeForm employeeform = (EmployeeForm)form;
        String empRealName = employeeform.getEmpRealName();
        String empSex = employeeform.getEmpSex();
        String empName = employeeform.getEmpName();
        String empBirth = employeeform.getEmpBirth();
        String empDep = employeeform.getEmpDep();
        String empSpe = employeeform.getEmpSpe();
        String empLeve = employeeform.getEmpLeve();
        String empClass = employeeform.getEmpClass();
        String empQq = employeeform.getEmpQq();
        String empPhone = employeeform.getEmpPhone();
        String empEmail = employeeform.getEmpEmail();
        String introduction = employeeform.getIntroduction();
        String org = employeeform.getOrg();
        String tec = employeeform.getTec();
        getServMgr().getEmployeeService().addEmployee(empName, empRealName, empSex, empBirth, empLeve, empDep, empSpe, empClass, empPhone, empQq, empEmail, introduction, org, tec);
        addMessage(request, "招聘信息发布成功");
        addRedirURL(request, "返回", "index_view.do");
        return mapping.findForward(EXECUTE_RESULT);
    }
}
